package com.rpc.common;

import com.rpc.config.RpcServiceConfig;

import java.util.HashMap;
import java.util.Map;

public class ChannelMaps {
    private static Map<String, RpcServiceConfig> maps = new HashMap<>();

    public static RpcServiceConfig getRpcServiceConfig(Invocation invocation){
        RpcServiceConfig rpcServiceConfig = maps.get(invocation.getInterfaceName() + invocation.getGroup() + invocation.getVersion());
        return rpcServiceConfig;
    }

    public static void putRpcServiceConfig(RpcServiceConfig rpcServiceConfig){
        maps.put(rpcServiceConfig.getRpcServiceName(), rpcServiceConfig);
    }
}
